package cn.pet.service.manage.utils;


import org.apache.commons.lang.RandomStringUtils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author zwr
 * @version 1.0
 * @description TODO
 * @date 2023/2/12 19:06
 */
public class OrderIDGenerate {

    public static String getOrderNumber(){
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");
        LocalDateTime localDateTime = LocalDateTime.now();
        String dateStr = localDateTime.format(fmt);
        String randomNumeric = RandomStringUtils.randomNumeric(8);
        return dateStr + randomNumeric;
    }

}
